<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>租客投诉受理</title>
<link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css"> 
<style type="text/css">
	#div3{
		padding-top:3px;
		width:1000px;
		margin:0 auto;
	}
	#div4{
		padding-top:3px;
		width:1000px;
		margin:0 auto;
	}
	#div5{
		width:1000px;
		margin:0 auto;
	}
	#div6{
		padding-top:3px;
		width:600px;
		margin:0 auto;
	}
	body{
		height:500px;
	}
	td{
		text-align:center;
	}
</style>
</head>

<body>
	<div style="margin-top:20px;">
		<div id="div3">
			<label style="color:blue">事件记录：</label>
			<table id="tb1" class="table table-bordered">
				<tr>
					<td>车位小区地址</td>
					<td>车位编号</td>
					<td>租赁开始时间</td>
					<td>租赁结束时间</td>
				</tr>
			</table>
		</div>
	
		<div id="div4">
			<label style="color:green" >投诉方：</label>
			<table id="tb2" class="table table-bordered">
				<tr>
					<td>用户名</td>
					<td>真实姓名</td>
					<td>身份证号码</td>
					<td>职业</td>
					<td>联系电话</td>
				</tr>
			</table>
		</div>
		
		<div id="div5">
			<label style="color:red">被投诉方：</label>
			<table id="tb3" class="table table-bordered">
				<tr>
					<td>用户名</td>
					<td>真实姓名</td>
					<td>身份证号码</td>
					<td>职业</td>
					<td>联系电话</td>
				</tr>
			</table>
		</div>
		
		<div id="div6">	
			<input type="button" id="yesBtn" value="投诉生效" class="btn btn-danger">
			<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</label>
			<input type="button" id="noBtn" value="投诉无效" class="btn btn-warning">
			<label>
				   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			</label>
			<a href="renterComplaint.jsp";">
				<input type="button" id="backBtn" value="暂缓处理" class="btn btn-primary">
			</a>
		</div>
	</div>
	<script type="text/javascript" src="../../js/jquery-3.1.0.min.js"></script>
	<script type="text/javascript">
	var compiii = 0;
	$(function(){
		var compidi=<%=request.getParameter("complaintRecordIDi")%>;
		compiii=compidi;
		sendInfo();
	})
	function sendInfo(){
		$.ajax({
			   type: "POST",
			   url: "../../sendComplaintInfo.do",
			   data: {"type":0,"complaintRecordID":compiii},
			   success: function(msg){
			     var str1="<tr><td>"+msg[0][0]+"</td><td>"+msg[0][1]+"</td><td>"+new Date(msg[0][2]).toLocaleDateString()+"</td><td>"+new Date(msg[0][3]).toLocaleDateString()+"</td></tr>"
			     $("#tb1").append(str1);
			     var str2="<tr><td>"+msg[0][10]+"</td><td>"+msg[0][11]+"</td><td>"+msg[0][12]+"</td><td>"+msg[0][13]+"</td><td>"+msg[0][14]+"</td></tr>"
	     		  +"<tr><td>投诉理由</td><td colspan='4'>"+msg[0][9]+"</td></tr>";
	     		 $("#tb2").append(str2);
			     var str3="<tr><td>"+msg[0][4]+"</td><td>"+msg[0][5]+"</td><td>"+msg[0][6]+"</td><td>"+msg[0][7]+"</td><td>"+msg[0][8]+"</td></tr>";
			     $("#tb3").append(str3);
			   }
		});
	}
	$("#yesBtn").click(
		function(){
			$.ajax({
				   type: "POST",
				   url: "../../updateComplaintrecord.do",
				   data: {"ispass":1,"complaint":0,"complaintRecordID":compiii},
				   success: function(msg){
				     alert( "投诉成功");
				     window.location.href="renterComplaint.jsp";
				   }
			});
		}
	);
	$("#noBtn").click(
		function(){
			$.ajax({
				   type: "POST",
				   url: "../../updateComplaintrecord.do",
				   data: {"ispass":0,"complaint":0,"complaintRecordID":compiii},
				   success: function(msg){
				     alert( "投诉失败已处理");
				     window.location.href="renterComplaint.jsp";
				   }
			});
		}
	);
	</script>
</body>
</html>